//
//  NSString+Utilities.m
//  groupecards
//
//  Created by Alan Chen on 12/12/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import "NSString+Utilities.h"

@implementation NSString (Utilities)

+ (NSString *)getImagesDirectory
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentDirectory = [paths lastObject];
    return [documentDirectory stringByAppendingPathComponent:@"images"];
}


- (BOOL)checkWithRegex:(NSString *)regex
{
    //NSString *Regex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; 
    NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; 
    return [emailTest evaluateWithObject:self]; 
}
@end
